check how many times a character appears in a string java

107

check how many times a character appears in a string java -

str.chars().filter(num -> num == '$').count()

Comments

Submit
0 Comments